using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Main.NPC
{
    /// <summary>
    /// 日程数据
    /// </summary>
    [Serializable]
    public class ScheduleDetails : IComparable<ScheduleDetails>
    {
        public int hour, minute, day;

        public int priority;

        public Season season;

        public string targetScene;

        public Vector2Int targetGridPosition;

        public AnimationClip clipAtStop;

        public bool interactable;

        public int Time => (hour * 100) + minute;

        public ScheduleDetails(int hour, int minute, int day, int priority, Season season, string targetScene, Vector2Int targetGridPosition, AnimationClip clipAtStop, bool interactable)
        {
            this.hour = hour;
            this.minute = minute;
            this.day = day;
            this.priority = priority;
            this.season = season;
            this.targetScene = targetScene;
            this.targetGridPosition = targetGridPosition;
            this.clipAtStop = clipAtStop;
            this.interactable = interactable;
        }

        public int CompareTo(ScheduleDetails other)
        {
            if (Time == other.Time)
            {
                return priority.CompareTo(other.priority);
            }
            else
            {
                return Time.CompareTo(other.Time);

            }
        }
    }
}